package com.tfb.boot.config;

import com.tfb.boot.bean.Cat;
import com.tfb.boot.bean.Dog;
import com.tfb.boot.bean.User;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

@Import(Dog.class)
@Configuration
public class MyConfig {
    @Bean
    public User user(){
        User user = new User();
        user.setUserName("zhangsan");
        user.setCat(cat());
        return user;
    }
    @Bean
    public Cat cat(){
        Cat cat = new Cat();
        cat.setName("tom");
        return cat;
    }
}
